ODDispatchModule
- Superclasses
- ODObject
- Subclasses
- none
An object of the
ODDispatchModule
class is used to distribute one or more event types.Description
Part editors do not receive events directly from the operating system; rather, OpenDoc receives events, interprets them, and dispatches them, using the dispatcher, to the appropriate part editor. The dispatcher uses dispatch module objects to dispatch specific events to individual parts. The dispatcher uses at least one internal dispatch module to handle standard events--such as mouse clicks, keystrokes, and menu commands--of a particular platform. Typically, you do not need to subclassODDispatchModule
or even access the internal dispatch module directly. However, you can extend the OpenDoc dispatching system by installing additional dispatch modules.The
ODDispatchModule
class is an abstract superclass that you can subclass to create a dispatch module. You can define dispatch modules to distribute new types of events or messages, such as the custom events generated by a data glove or pen, to your part editor. Each dispatch module is responsible for determining the frame or part to which it dispatches an event.You can create a dispatch module object either from within a shell plug-in or from within one of your part's methods that are called during startup.
Your part editor can also install a dispatch module as a monitor, using the dispatcher's
AddMonitor
method (page 114). In this case, you can monitor the event stream without interfering with it. By registering a dispatch module as a monitor for a specified event type, OpenDoc notifies the dispatch module when an event of that type occurs. You might use a monitor in a debugging environment to monitor events and display a log of the events in a window. There can be one or more monitors for each event type.For more information related to the dispatcher, see the
ODDispatcher
class description (page 110). For more information on event handling in OpenDoc, see the chapter on user events in theOpenDoc Programmer's Guide for the MacOS . Overriding Inherited Methods
The following methods are inherited and available for use by your subclass ofODDispatchModule
.somInit
ThesomInit
method initializes the instance variables in a System Object Model(TM) (SOM(TM)) object; it is inherited from theSOMObject
class.If you subclass
ODDispatchModule
, you can override this method. Your override method does not need to call its inherited method; the inherited method is automatically called for you by the SOM library.Your override of this method should initialize the new instance variables in this dispatch module object. The SOM library calls this method when this dispatch module is created. You must not do anything that might fail in this method. This limits you to operations like setting pointer variables to null, setting numeric variables to appropriate values, and making similar assignments from constants. If you have any initialization code that can potentially fail, it must be handled in this dispatch module's subclass-specific initialization method; see also the
InitDispatchModule
method (page 130).somUninit
ThesomUninit
method disposes of the storage created for a SOM object; it is inherited from theSOMObject
class.If you subclass
ODDispatchModule
, you can override this method. Your override method does not need to call its inherited method; the inherited method is automatically called for you by the SOM library.Your override of this method should dispose of any storage created for this dispatch module object, including any storage related to additional instance variables initialized in this dispatch module object. The SOM library calls this method when this dispatch module is deleted; this method must not fail.
Methods
This section presents summary descriptions of theODDispatchModule
methods grouped according to purpose, followed by detailed descriptions in alphabetical order.
InitDispatchModule
- Initializes this dispatch module object.
Dispatch
- Should dispatch the specified event to the appropriate part.
Methods
Dispatch
InitDispatchModule
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help